package com.cqjtu.eecs.entity;

import java.math.BigDecimal;
import java.io.Serializable;

import com.cqjtu.eecs.entity.dto.TrainingProjectDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 
 * </p>
 *
 * @author   
 * @since 2022-02-28
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="TrainingProject对象", description="")
public class TrainingProject implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "专业代码")
    private String majorCode;

    @ApiModelProperty(value = "版本编号")
    private String versionCode;

    @ApiModelProperty(value = "版本名称")
    private String versionName;

    @ApiModelProperty(value = "毕业学分")
    private BigDecimal graduateCredit;

    @ApiModelProperty(value = "基本学制")
    private Integer basicYear;

    public TrainingProject(TrainingProjectDTO trainingProjectDTO){
        this.majorCode = trainingProjectDTO.getMajorCode();
        this.versionCode = trainingProjectDTO.getVersionCode();
        this.versionName = trainingProjectDTO.getVersionName();
        this.graduateCredit = new BigDecimal(trainingProjectDTO.getGraduateCredit());
        this.basicYear = Integer.parseInt(trainingProjectDTO.getBasicYear());
    }
}
